Completed
Push — master ( f9124f...ad496b )
by Dimas
09:47
created

roles.js ➔ initializeSelect2   F

Complexity

Conditions 22

Size

Total Lines 34
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 34
rs 0
c 0
b 0
f 0
cc 22

How to fix   Complexity   

Complexity

Complex classes like roles.js ➔ initializeSelect2 often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1
function deleteRole(role) {
2
  console.log(getFuncName(), role);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
3
}
4
5
AjaxForm();
6